<?php
namespace app\user\controller;
use app\user\controller\Base;
use think\Session;
use think\db;
use think\Request;

class Index extends Base
{
    public function home()
    {

        $uname=Session::get('user_name');
        $upwd=Session::get('user_pwd');

        $map = [
            'name' => $uname,
            'password' => $upwd
        ];
        $select=db('ole_users')->where($map)->find();
        $this->assign('user',$select);              // 传递变量
        $this ->display('./index/home.html');
        return $this->fetch('index/home',$select);
    }
//    渲染用户信息展示页面
    public function info()
    {
//       获取Session


////        执行查询用户信息
//        $user=M();
//        $select=$user->query("select * from ole_users where name='$uname' and password='$upwd'");
//
//        $this->assign('index/home',$select);              // 传递变量
//        $this ->display('home.html');
    }
}